//
//  BrokerCell.m
//  WGFGlobalHouses
//
//  Created by welldone on 15/5/21.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "BrokerCell.h"

@implementation BrokerCell
@synthesize brokerView;

+(instancetype) cellWithTableView:(UITableView *)tableview{
    return nil;
}


-(void)initWithTableView:(UITableView*)tableView{
    
    self.delegate = tableView;
    
    self.showFuntionBtn1 = true;
    self.showFuntionBtn2 = true;
    self.showFuntionBtn3 = true;
    [self setContentHight:60];
    
    
    brokerView = [BrokerCellView  creatView];
    
    
    [brokerView setFrame:CGRectMake(0, 0, self.contentMoveView.frame.size.width, self.contentMoveView.frame.size.height)];
    
    [self.brokerView setUserInteractionEnabled:false];
    
    [self.contentMoveView addSubview:brokerView];
    
    [self.funtionBtn1 addTarget:self action:@selector(btnOnclick:) forControlEvents:UIControlEventTouchUpInside];
    [self.funtionBtn2 addTarget:self action:@selector(btnOnclick:) forControlEvents:UIControlEventTouchUpInside];
    [self.funtionBtn3 addTarget:self action:@selector(btnOnclick:) forControlEvents:UIControlEventTouchUpInside];
}


+(CGFloat)getHight:(CellBaseData*)data withTableView:(UITableView*)tableView{
    
    
    return 60;
}

-(void)setData:(BorkerCellModel*)data{
   
    _data = data;
    brokerView.data = data;
    [self reSetfuntionBtn2TitleWithStauts:data.status];
    
}

-(void)setIsEditMode:(Boolean)isEditMode{

 
    [self cloadMenu];
    
    [self setScrollAble:!isEditMode];
    
    [self.brokerView setIsEditMode:isEditMode];
}


-(void)beQueryStyleCell{

    [self cloadMenu];
    
    [self setScrollAble:false];

    
    [self.brokerView beQueryStyleCell];
}




-(void)btnOnclick:(UIButton *)btn
{
    if (self.btnDelegate && [self.btnDelegate respondsToSelector:@selector(brokerCellFuntionBtnOnClickedWithBtn:WithModel:)]) {
        [self.btnDelegate brokerCellFuntionBtnOnClickedWithBtn:btn WithModel:self.data];
    }
}
@end
